@import "ui-variables";

.nuclide-debugger-container {
  display: flex;
}

.nuclide-debugger-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.nuclide-debugger-root select.form-control {
  color: @text-color;
  background-color: @button-background-color;
  border-color: @button-border-color;
}

.nuclide-debugger-root .control-bar {
  display: flex;
  flex-direction: row-reverse;
}

.nuclide-debugger-root-close-button {
  background: transparent;
  border: none;
  padding: 0;
  position: absolute;
  top: 2.5em;
  right: 0.5em;
  z-index: 1;
}

.nuclide-debugger-root .inspector {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nuclide-debugger-container-old-enabled {
  display: flex;
  flex-grow: 1;
}

.nuclide-debugger-container-new {
  flex-grow: 1;
  flex-basis: 0;
  overflow: auto;
  padding-right: 0.5em;
}

.nuclide-debugger-webview-hidden {
  height: 0;
  overflow: hidden;
}

/*
Hack for flexbox + vertical scaling with webview shadow dom.
Use flexbox cross-axis stretch to fill the vertical space.
*/

.nuclide-debugger-vfill-parent() {
  display: flex;
  flex-direction:row;
  align-children: stretch;
  align-items: stretch;
}

.nuclide-debugger-vfill-child() {
  flex: 1 0 auto;
}

.nuclide-debugger-webview {
  background-color: #fff;
  .nuclide-debugger-vfill-parent();
  .nuclide-debugger-vfill-child(); // child relative to .inspector

  &::shadow object {
    .nuclide-debugger-vfill-child();
    // The object element is generated with inline style height:100%.
    height: auto !important;
  }
}

/* General debugger UI */
.nuclide-debugger-section-content {
  max-height: 20em;
  overflow-y: auto;
}

/* Watch Expressions */
@leftMargin: 0.5em;

.nuclide-debugger-expression-value-list {
  margin: 0 @leftMargin;
}

.nuclide-debugger-expression-value-row {
  display: flex;
  flex-direction: row;
  font-family: Menlo, Monaco, Consolas, monospace;
  justify-content: space-between;
  min-height: 23px; // Match height of AtomInput to prevent list items from jumping around.
  overflow: auto;
}

.nuclide-debugger-expression-value-content {
  display: flex;
  flex-direction: row;
  flex-grow: 1;
}

.nuclide-debugger-watch-expression-xout {
  cursor: pointer;
  opacity: 0;
}

.nuclide-debugger-watch-expression-row:hover {
  background-color: @background-color-highlight;

  .nuclide-debugger-watch-expression-xout {
    opacity: 0.5;
  }
}

.nuclide-debugger-watch-expression-xout.nuclide-debugger-watch-expression-xout:hover {
  opacity: 1;
}

.nuclide-debugger-watch-expression-input {
  // Vertically align listed watch expressions with input.
  margin-left: -@leftMargin;
}

.nuclide-debugger-watch-expression-add-new-input {
  margin-top: 0.5em;
}

/* Call stack */
.nuclide-debugger-callstack-item {
  display: flex;
  justify-content: space-between;
}

.nuclide-debugger-callstack-name {
  font-family: Menlo, Monaco, Consolas, monospace;
}

/* Stepping controls */
.nuclide-debugger-stepping-component {
  display: flex;
  flex-wrap: wrap;
}

.nuclide-debugger-stepping-svg-button {
  div {
    width: 10px;
  }
  svg {
    width: 20px;
    fill: @text-color;
    margin: 0 auto;
    position: relative;
    left: -5px;
    vertical-align: baseline;
    top: 3px;
  }
  svg:hover {
    fill: @text-color-highlight;
  }
}

.nuclide-debugger-stepping-buttongroup {
  margin-right: 1em;
}

.nuclide-debugger-exception-checkbox {
  cursor: pointer;
  margin-right: 0.5em;
  margin-top: 4px;
}

.nuclide-debugger-exception-fragment {
  margin: 5px 0 0 0.5em;
}

/* Thread list */
.nuclide-debugger-thread-list-item-selected {
  color: @text-color-highlight;
  font-weight: bold;
}

.nuclide-debugger-thread-list-empty {
  font-style: italic;
  padding: 1em;
  text-align: center;
}

.nuclide-debugger-thread-list-item-current-indicator {
  text-align: center;
}

/* Thread switch datatip */
.nuclide-debugger-thread-switch-alert {
    padding: 1px 4px;
    font-weight: bold;
    color: @text-color-warning;
}
